package Proyecto.Modelo;

import java.io.Serializable;
import javax.persistence.*;
import java.sql.Time;
import java.util.Set;


/**
 * The persistent class for the pelicula database table.
 * 
 */
@Entity
@Table(name="pelicula")
public class Pelicula implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private int idPelicula;

	private String censura;

	private String comentario;

	private String descricion;

	private String director;

	private Time duracion;

	private String pagweb;

	private String pais;

	@Column(name="Titulo")
	private String titulo;

	private String urlTrailer;

	//bi-directional many-to-many association to Cliente
    @ManyToMany
	@JoinTable(
		name="cliente_has_pelicula"
		, joinColumns={
			@JoinColumn(name="Pelicula_idPelicula")
			}
		, inverseJoinColumns={
			@JoinColumn(name="Cliente_idCliente")
			}
		)
	private Set<Cliente> clientes;

	//bi-directional many-to-one association to Cartelera
    @ManyToOne
	private Cartelera cartelera;

	//bi-directional many-to-many association to Genero
    @ManyToMany
	@JoinTable(
		name="pelicula_has_genero"
		, joinColumns={
			@JoinColumn(name="Pelicula_idPelicula")
			}
		, inverseJoinColumns={
			@JoinColumn(name="Genero_idGenero")
			}
		)
	private Set<Genero> generos;

	//bi-directional many-to-many association to Local
    @ManyToMany
	@JoinTable(
		name="pelicula_has_local"
		, joinColumns={
			@JoinColumn(name="Pelicula_idPelicula")
			}
		, inverseJoinColumns={
			@JoinColumn(name="Local_idLocal")
			}
		)
	private Set<Local> locals;

    public Pelicula() {
    }

	public int getIdPelicula() {
		return this.idPelicula;
	}

	public void setIdPelicula(int idPelicula) {
		this.idPelicula = idPelicula;
	}

	public String getCensura() {
		return this.censura;
	}

	public void setCensura(String censura) {
		this.censura = censura;
	}

	public String getComentario() {
		return this.comentario;
	}

	public void setComentario(String comentario) {
		this.comentario = comentario;
	}

	public String getDescricion() {
		return this.descricion;
	}

	public void setDescricion(String descricion) {
		this.descricion = descricion;
	}

	public String getDirector() {
		return this.director;
	}

	public void setDirector(String director) {
		this.director = director;
	}

	public Time getDuracion() {
		return this.duracion;
	}

	public void setDuracion(Time duracion) {
		this.duracion = duracion;
	}

	public String getPagweb() {
		return this.pagweb;
	}

	public void setPagweb(String pagweb) {
		this.pagweb = pagweb;
	}

	public String getPais() {
		return this.pais;
	}

	public void setPais(String pais) {
		this.pais = pais;
	}

	public String getTitulo() {
		return this.titulo;
	}

	public void setTitulo(String titulo) {
		this.titulo = titulo;
	}

	public String getUrlTrailer() {
		return this.urlTrailer;
	}

	public void setUrlTrailer(String urlTrailer) {
		this.urlTrailer = urlTrailer;
	}

	public Set<Cliente> getClientes() {
		return this.clientes;
	}

	public void setClientes(Set<Cliente> clientes) {
		this.clientes = clientes;
	}
	
	public Cartelera getCartelera() {
		return this.cartelera;
	}

	public void setCartelera(Cartelera cartelera) {
		this.cartelera = cartelera;
	}
	
	public Set<Genero> getGeneros() {
		return this.generos;
	}

	public void setGeneros(Set<Genero> generos) {
		this.generos = generos;
	}
	
	public Set<Local> getLocals() {
		return this.locals;
	}

	public void setLocals(Set<Local> locals) {
		this.locals = locals;
	}
	
}